package com.knight.hadoop.day04.mythread.thread.blockingqueue;

import java.util.concurrent.BlockingQueue;

/**
 * 生产者
 * @author YQ
 *
 */
public class Producer implements Runnable{
	
	
	private BlockingQueue<String> queue;
	
	public Producer(BlockingQueue<String> queue){
		this.queue = queue;
	}
	
	
	@Override
	public void run() {
		System.out.println("product: "+"made a product: "+Thread.currentThread().getName());
		try {
			queue.put("A product："+Thread.currentThread().getName());
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

}
